package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.github.kotvertolet.youtubejextractor.models.youtube.playerResponse.FeedbackEndpoint;
import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

public class ServiceEndpoint implements Sequenceable, Serializable {


    @SerializedName("feedbackEndpoint")
    private FeedbackEndpoint feedbackEndpoint;

    @SerializedName("commandMetadata")
    private CommandMetadata commandMetadata;

    @SerializedName("clickTrackingParams")
    private String clickTrackingParams;



    public static final Sequenceable.Producer<ServiceEndpoint> CREATOR = new Producer<ServiceEndpoint>() {
        @Override
        public ServiceEndpoint createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ServiceEndpoint serviceEndpoint = new ServiceEndpoint();
            serviceEndpoint.unmarshalling(parcel);
            return serviceEndpoint;
        }
    };


    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.feedbackEndpoint);
        parcel.writeSequenceable(this.commandMetadata);
        parcel.writeString(this.clickTrackingParams);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.feedbackEndpoint);
        parcel.readSequenceable(this.commandMetadata);
        this.clickTrackingParams=parcel.readString();
        return true;
    }

    @Override
    public String toString() {
        return "ServiceEndpoint{" +
                "feedbackEndpoint=" + feedbackEndpoint +
                ", commandMetadata=" + commandMetadata +
                ", clickTrackingParams='" + clickTrackingParams + '\'' +
                '}';
    }

    public FeedbackEndpoint getFeedbackEndpoint() {
        return feedbackEndpoint;
    }

    public void setFeedbackEndpoint(FeedbackEndpoint feedbackEndpoint) {
        this.feedbackEndpoint = feedbackEndpoint;
    }

    public CommandMetadata getCommandMetadata() {
        return commandMetadata;
    }

    public void setCommandMetadata(CommandMetadata commandMetadata) {
        this.commandMetadata = commandMetadata;
    }

    public String getClickTrackingParams() {
        return clickTrackingParams;
    }

    public void setClickTrackingParams(String clickTrackingParams) {
        this.clickTrackingParams = clickTrackingParams;
    }
}
